package com.iplant.pdm.service.po.fpc;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.join.multi.DBJoinMulti;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 产品质量参数
 *
 * @author 7401136923cdec15
 * 2023-7-20 10:27:24
 */
@DBBasePO(TableName = "fpc_product_parameter", CheckName = {"Code", "RouteID,Name,ParamType,StationID"}, Schemas =
        DBSchemas.PDM, CodeAuto = true, CodePrefix = "PRM-", CodeNum = 4)
public class FPCProductParameter extends BasePO implements Serializable {

    private static final long serialVersionUID = 1L;

    @DBField
    @DBCondition
    public int ProductID = 0;//产品ID
    @DBJoin(name = "Name", tableName = "fpc_product", tableAsName = "f1", Schemas = DBSchemas.PDM,
            MainTableField = "ProductID")
    public String ProductName = "";//产品名称
    @DBJoin(name = "Code", tableName = "fpc_product", tableAsName = "f1", Schemas = DBSchemas.PDM,
            MainTableField = "ProductID")
    public String ProductCode = "";//产品编码
    @DBField
    public String TheoreticalValue = "";//理论值
    @DBField
    public double UpperTolerance = 0.0;//上公差
    @DBField
    public double LowerTolerance = 0.0;//下公差

    /**
     * 参数类型
     */
    @DBCondition
    @DBField
    public int ParamType = 0;

    /**
     * 标准类型
     */
    @DBField
    public int StandardType = 0;

    /**
     * 标准值
     */
    @DBField
    public String StandardValue = "";
    /**
     * 基准值
     */
    @DBField
    public String StandardBasic = "";
    /**
     * 默认值
     */
    @DBField
    public String DefaultValue = "";

    /**
     * 下限值
     */
    @DBField
    public double StandardLeft = 0.0;
    /**
     * 上限值
     */
    @DBField
    public double StandardRight = 0.0;

    /**
     * 工位ID
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.findInSet)
    @DBField
    public List<Integer> StationID = new ArrayList<>();
    /**
     * 工位名称
     */
    @DBJoinMulti(Name = "Name", MainTableField = "StationID", TableName = "fmc_station", Schemas = DBSchemas.Basic)
    public String StationName = "";
    /**
     * 工位编码
     */
    @DBJoinMulti(Name = "Code", MainTableField = "StationID", TableName = "fmc_station", Schemas = DBSchemas.Basic)
    public String StationCode = "";

    /**
     * 控制目标值
     */
    @DBField
    public double ControlTargetValue = 0.0;
    /**
     * 控制下限值
     */
    @DBField
    public double ControlLeftValue = 0.0;
    /**
     * 控制上限值
     */
    @DBField
    public double ControlRightValue = 0.0;
    /**
     * 报警下限值
     */
    @DBField
    public double AlarmLeftValue = 0.0;
    /**
     * 报警上限值
     */
    @DBField
    public double AlarmRightValue = 0.0;

    /**
     * 工艺路线ID（参数需要与bop绑定，实现版本管理）
     */
    @DBCondition
    @DBField
    public int RouteID = 0;

    /**
     * 工艺bop版本号
     */
    @DBJoin(name = "Version", tableName = "fpc_route", tableAsName = "fpc_route1", Schemas = DBSchemas.PDM,
            MainTableField = "RouteID")
    public String RouteVersion = "";

    /**
     * 关联的采集参数编号
     */
    @DBField
    public String CollectionNumber = "";
    /**
     * 是否输出打印
     */
    @DBField
    public int IsPrint = 0;

    /**
     * 单位ID
     */
    @DBField
    public int UnitID = 0;
    /**
     * 单位名称
     */
    @DBJoin(name = "Name", tableName = "mss_unit", tableAsName = "mss_unit1", Schemas = DBSchemas.Basic,
            MainTableField = "UnitID")
    public String UnitName = "";
    /**
     * 单位编码
     */
    @DBJoin(name = "Code", tableName = "mss_unit", tableAsName = "mss_unit1", Schemas = DBSchemas.Basic,
            MainTableField = "UnitID")
    public String UnitCode = "";

    /**
     *历史参数ID（版本复制时使用）
     */
    @DBCondition
    @DBField
    public int HisProductParameterID=0;

    @JsonProperty("StandardLeft")
    public double getStandardLeft() {
        return StandardLeft;
    }

    public void setStandardLeft(double standardLeft) {
        StandardLeft = standardLeft;
    }

    @JsonProperty("StandardRight")
    public double getStandardRight() {
        return StandardRight;
    }

    public void setStandardRight(double standardRight) {
        StandardRight = standardRight;
    }

    @JsonProperty("StandardValue")
    public String getStandardValue() {
        return StandardValue;
    }

    public void setStandardValue(String standardValue) {
        StandardValue = standardValue;
    }

    @JsonProperty("StandardBasic")
    public String getStandardBasic() {
        return StandardBasic;
    }

    public void setStandardBasic(String standardBasic) {
        StandardBasic = standardBasic;
    }

    @JsonProperty("DefaultValue")
    public String getDefaultValue() {
        return DefaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        DefaultValue = defaultValue;
    }

    @JsonProperty("StandardType")
    public int getStandardType() {
        return StandardType;
    }

    public void setStandardType(int standardType) {
        StandardType = standardType;
    }

    @JsonProperty("ProductID")
    public int getProductID() {
        return ProductID;
    }

    public void setProductID(int productID) {
        ProductID = productID;
    }

    @JsonProperty("ProductName")
    public String getProductName() {
        return ProductName;
    }

    public void setProductName(String productName) {
        ProductName = productName;
    }

    @JsonProperty("ProductCode")
    public String getProductCode() {
        return ProductCode;
    }

    public void setProductCode(String productCode) {
        ProductCode = productCode;
    }

    @JsonProperty("TheoreticalValue")
    public String getTheoreticalValue() {
        return TheoreticalValue;
    }

    public void setTheoreticalValue(String theoreticalValue) {
        TheoreticalValue = theoreticalValue;
    }

    @JsonProperty("UpperTolerance")
    public double getUpperTolerance() {
        return UpperTolerance;
    }

    public void setUpperTolerance(double upperTolerance) {
        UpperTolerance = upperTolerance;
    }

    @JsonProperty("LowerTolerance")
    public double getLowerTolerance() {
        return LowerTolerance;
    }

    public void setLowerTolerance(double lowerTolerance) {
        LowerTolerance = lowerTolerance;
    }

    @JsonProperty("ParamType")
    public int getParamType() {
        return ParamType;
    }

    public void setParamType(int paramType) {
        ParamType = paramType;
    }

    @JsonProperty("StationID")
    public List<Integer> getStationID() {
        return StationID;
    }

    public void setStationID(List<Integer> stationID) {
        StationID = stationID;
    }

    @JsonProperty("StationName")
    public String getStationName() {
        return StationName;
    }

    public void setStationName(String stationName) {
        StationName = stationName;
    }

    @JsonProperty("StationCode")
    public String getStationCode() {
        return StationCode;
    }

    public void setStationCode(String stationCode) {
        StationCode = stationCode;
    }

    @JsonProperty("ControlTargetValue")
    public double getControlTargetValue() {
        return ControlTargetValue;
    }

    public void setControlTargetValue(double controlTargetValue) {
        ControlTargetValue = controlTargetValue;
    }

    @JsonProperty("ControlLeftValue")
    public double getControlLeftValue() {
        return ControlLeftValue;
    }

    public void setControlLeftValue(double controlLeftValue) {
        ControlLeftValue = controlLeftValue;
    }

    @JsonProperty("ControlRightValue")
    public double getControlRightValue() {
        return ControlRightValue;
    }

    public void setControlRightValue(double controlRightValue) {
        ControlRightValue = controlRightValue;
    }

    @JsonProperty("AlarmLeftValue")
    public double getAlarmLeftValue() {
        return AlarmLeftValue;
    }

    public void setAlarmLeftValue(double alarmLeftValue) {
        AlarmLeftValue = alarmLeftValue;
    }

    @JsonProperty("AlarmRightValue")
    public double getAlarmRightValue() {
        return AlarmRightValue;
    }

    public void setAlarmRightValue(double alarmRightValue) {
        AlarmRightValue = alarmRightValue;
    }

    @JsonProperty("RouteID")
    public int getRouteID() {
        return RouteID;
    }

    public void setRouteID(int routeID) {
        RouteID = routeID;
    }

    @JsonProperty("RouteVersion")
    public String getRouteVersion() {
        return RouteVersion;
    }

    public void setRouteVersion(String routeVersion) {
        RouteVersion = routeVersion;
    }

    @JsonProperty("CollectionNumber")
    public String getCollectionNumber() {
        return CollectionNumber;
    }

    public void setCollectionNumber(String collectionNumber) {
        CollectionNumber = collectionNumber;
    }

    @JsonProperty("IsPrint")
    public int getIsPrint() {
        return IsPrint;
    }

    public void setIsPrint(int isPrint) {
        IsPrint = isPrint;
    }

    @JsonProperty("UnitID")
    public int getUnitID() {
        return UnitID;
    }

    public void setUnitID(int unitID) {
        UnitID = unitID;
    }

    @JsonProperty("UnitName")
    public String getUnitName() {
        return UnitName;
    }

    public void setUnitName(String unitName) {
        UnitName = unitName;
    }

    @JsonProperty("UnitCode")
    public String getUnitCode() {
        return UnitCode;
    }

    public void setUnitCode(String unitCode) {
        UnitCode = unitCode;
    }

    @JsonProperty("HisProductParameterID")
    public int getHisProductParameterID() {
        return HisProductParameterID;
    }

    public void setHisProductParameterID(int hisProductParameterID) {
        HisProductParameterID = hisProductParameterID;
    }
}
